home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / veryco1a / form1.frm (.txt) next >
Encoding:
Visual Basic Form  |  1999-09-28  |  8.5 KB  |  259 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    ClientHeight    =   3150
  5.    ClientLeft      =   45
  6.    ClientTop       =   345
  7.    ClientWidth     =   4680
  8.    ControlBox      =   0   'False
  9.    Icon            =   "Form1.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   3150
  14.    ScaleWidth      =   4680
  15.    StartUpPosition =   2  'CenterScreen
  16.    Begin VB.Timer Timer2 
  17.       Interval        =   3000
  18.       Left            =   3720
  19.       Top             =   0
  20.    End
  21.    Begin VB.PictureBox Picture1 
  22.       BorderStyle     =   0  'None
  23.       ClipControls    =   0   'False
  24.       Enabled         =   0   'False
  25.       Height          =   735
  26.       Left            =   1590
  27.       Picture         =   "Form1.frx":030A
  28.       ScaleHeight     =   735
  29.       ScaleWidth      =   1500
  30.       TabIndex        =   1
  31.       Top             =   2280
  32.       Width           =   1500
  33.       Begin VB.Image Skin 
  34.          Height          =   735
  35.          Left            =   0
  36.          Picture         =   "Form1.frx":0A63
  37.          Top             =   0
  38.          Width           =   1455
  39.       End
  40.       Begin VB.Image Pupil 
  41.          Height          =   375
  42.          Index           =   0
  43.          Left            =   240
  44.          Picture         =   "Form1.frx":135F
  45.          Top             =   240
  46.          Width           =   375
  47.       End
  48.       Begin VB.Image Pupil 
  49.          Height          =   375
  50.          Index           =   1
  51.          Left            =   960
  52.          Picture         =   "Form1.frx":17A4
  53.          Top             =   240
  54.          Width           =   375
  55.       End
  56.    End
  57.    Begin VB.Timer Timer1 
  58.       Interval        =   100
  59.       Left            =   4200
  60.       Top             =   0
  61.    End
  62.    Begin VB.Image Image1 
  63.       Height          =   735
  64.       Index           =   3
  65.       Left            =   0
  66.       Picture         =   "Form1.frx":1BE9
  67.       Top             =   2280
  68.       Visible         =   0   'False
  69.       Width           =   1455
  70.    End
  71.    Begin VB.Image Image1 
  72.       Height          =   735
  73.       Index           =   2
  74.       Left            =   0
  75.       Picture         =   "Form1.frx":266A
  76.       Top             =   2040
  77.       Visible         =   0   'False
  78.       Width           =   1455
  79.    End
  80.    Begin VB.Image Image1 
  81.       Height          =   735
  82.       Index           =   1
  83.       Left            =   0
  84.       Picture         =   "Form1.frx":306E
  85.       Top             =   1800
  86.       Visible         =   0   'False
  87.       Width           =   1455
  88.    End
  89.    Begin VB.Image Image1 
  90.       Height          =   735
  91.       Index           =   0
  92.       Left            =   0
  93.       Picture         =   "Form1.frx":39D8
  94.       Top             =   1560
  95.       Visible         =   0   'False
  96.       Width           =   1455
  97.    End
  98.    Begin VB.Label Window 
  99.       Alignment       =   2  'Center
  100.       BackColor       =   &H00FFFFFF&
  101.       Height          =   435
  102.       Left            =   330
  103.       TabIndex        =   3
  104.       Top             =   1200
  105.       Width           =   4005
  106.    End
  107.    Begin VB.Label Label2 
  108.       AutoSize        =   -1  'True
  109.       BackColor       =   &H00FFFFFF&
  110.       Caption         =   "Window under cursor:"
  111.       BeginProperty Font 
  112.          Name            =   "MS Sans Serif"
  113.          Size            =   8.25
  114.          Charset         =   0
  115.          Weight          =   700
  116.          Underline       =   0   'False
  117.          Italic          =   0   'False
  118.          Strikethrough   =   0   'False
  119.       EndProperty
  120.       Height          =   195
  121.       Left            =   1560
  122.       TabIndex        =   2
  123.       Top             =   960
  124.       Width           =   1875
  125.    End
  126.    Begin VB.Shape Shape4 
  127.       BorderColor     =   &H00FFFFFF&
  128.       FillColor       =   &H00FFFFFF&
  129.       FillStyle       =   0  'Solid
  130.       Height          =   495
  131.       Left            =   3360
  132.       Shape           =   3  'Circle
  133.       Top             =   1880
  134.       Width           =   495
  135.    End
  136.    Begin VB.Shape Shape3 
  137.       BorderColor     =   &H00FFFFFF&
  138.       FillColor       =   &H00FFFFFF&
  139.       FillStyle       =   0  'Solid
  140.       Height          =   1095
  141.       Left            =   120
  142.       Shape           =   2  'Oval
  143.       Top             =   840
  144.       Width           =   4455
  145.    End
  146.    Begin VB.Shape Shape2 
  147.       BorderColor     =   &H00FFFFFF&
  148.       FillColor       =   &H00FFFFFF&
  149.       FillStyle       =   0  'Solid
  150.       Height          =   255
  151.       Left            =   3240
  152.       Shape           =   3  'Circle
  153.       Top             =   2400
  154.       Width           =   255
  155.    End
  156.    Begin VB.Shape Shape1 
  157.       BorderColor     =   &H00FFFFFF&
  158.       FillColor       =   &H00FFFFFF&
  159.       FillStyle       =   0  'Solid
  160.       Height          =   135
  161.       Left            =   3120
  162.       Shape           =   3  'Circle
  163.       Top             =   2640
  164.       Width           =   135
  165.    End
  166.    Begin VB.Label Label1 
  167.       Alignment       =   2  'Center
  168.       Caption         =   "I'm watching you!"
  169.       Enabled         =   0   'False
  170.       BeginProperty Font 
  171.          Name            =   "Arial"
  172.          Size            =   21.75
  173.          Charset         =   0
  174.          Weight          =   700
  175.          Underline       =   0   'False
  176.          Italic          =   -1  'True
  177.          Strikethrough   =   0   'False
  178.       EndProperty
  179.       Height          =   615
  180.       Left            =   120
  181.       TabIndex        =   0
  182.       Top             =   120
  183.       Width           =   4455
  184.    End
  185.    Begin VB.Menu mnuFile 
  186.       Caption         =   "&File"
  187.       Begin VB.Menu mnuAbout 
  188.          Caption         =   "&About"
  189.       End
  190.       Begin VB.Menu mnuSpace1 
  191.          Caption         =   "-"
  192.       End
  193.       Begin VB.Menu mnuExit 
  194.          Caption         =   "&Exit"
  195.       End
  196.    End
  197. Attribute VB_Name = "Form1"
  198. Attribute VB_GlobalNameSpace = False
  199. Attribute VB_Creatable = False
  200. Attribute VB_PredeclaredId = True
  201. Attribute VB_Exposed = False
  202. Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hWnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
  203. Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
  204. Private Declare Function GetWindow Lib "user32" (ByVal hWnd As Long, ByVal wCmd As Long) As Long
  205. Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
  206. Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
  207. Private Type POINTAPI
  208.     X As Long
  209.     Y As Long
  210. End Type
  211. Private XT(1) As Single, YT As Single, M As Single
  212. Private XScreen As Single, YScreen As Single
  213. Private I As Integer, II As Integer
  214. Private Const MAX_DELOCATION = 250
  215. Private Const PUPIL_DISTANCE = 30
  216. Private Sub Form_Load()
  217.     XT(0) = Skin.Left - Pupil(0).Width / 2 + MAX_DELOCATION + PUPIL_DISTANCE
  218.     XT(1) = Skin.Left + Skin.Width / 2 - Pupil(1).Width / 2 + MAX_DELOCATION - PUPIL_DISTANCE
  219.     YT = Skin.Top - Pupil(0).Height / 2 + MAX_DELOCATION
  220.     M = Skin.Width / 2 - MAX_DELOCATION * 2
  221.     XScreen = Screen.Width / Screen.TwipsPerPixelX
  222.     YScreen = Screen.Height / Screen.TwipsPerPixelY
  223.     II = 1
  224. End Sub
  225. Private Sub mnuAbout_Click()
  226.     MsgBox "Programmed by Pedro Lamas" & vbCrLf & "Copyright 
  227. 1997-1999 Underground Software" & vbCrLf & vbCrLf & "Home-Page (Dedicated to VB): www.terravista.pt/portosanto/3723/" & vbCrLf & "E-Mail: sniper@hotpop.com", 9 + vbInformation, "Credits!"
  228. End Sub
  229. Private Sub mnuExit_Click()
  230.     End
  231. End Sub
  232. Private Sub Timer1_Timer()
  233.     Dim CP As POINTAPI, hWnd As Long, S As String
  234.     GetCursorPos CP
  235.     Pupil(0).Move XT(0) + CP.X * M / XScreen, YT + CP.Y * M / YScreen
  236.     Pupil(1).Move XT(1) + CP.X * M / XScreen, YT + CP.Y * M / YScreen
  237.     hWnd = WindowFromPoint(CP.X, CP.Y)
  238.     S = Space(128)
  239.     GetWindowText hWnd, S, 128
  240.     If Asc(Left(S, 1)) = 0 Then GetClassName hWnd, S, 128
  241.     Window.Caption = S
  242.     'With Picture1
  243.     '    .PaintPicture Image1(I).Picture, Skin.Left, Skin.Top
  244.     '    .PaintPicture Pupil(0).Picture, Pupil(0).Left, Pupil(0).Top
  245.     '    .PaintPicture Pupil(1).Picture, Pupil(1).Left, Pupil(1).Top
  246.     'End With
  247.     DoEvents
  248. End Sub
  249. Private Sub Timer2_Timer()
  250.     If I + II < 0 Or I + II > 3 Then II = -II
  251.     I = I + II
  252.     Skin.Picture = Image1(I)
  253.     If I = 0 Then
  254.         Timer2.Interval = 3000
  255.     Else
  256.         Timer2.Interval = 100
  257.     End If
  258. End Sub
  259.